package net.zjitc.demosecurity6.controller;


/**
 * @Author zhao
 * @DATE 2025/4/25 10:28
 */

import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

    //1--admin
    @PreAuthorize("hasAnyAuthority('sys:goods:test1')")
    @GetMapping("/test1")
    public String test1(){
        return "test1";
    }

    //2-lisi
    @PreAuthorize("hasAnyAuthority('sys:goods:test2')")
    @GetMapping("/test2")
    public String test(){
        return "test2";
    }

}
